package data_structure.entry;


/**
 * student实体类
 */

public class Student implements Comparable<Student>{

    private String name;
    private int score;

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    @Override
    /**
     * sequenced from minimum to maximum
     */
    public int compareTo(Student another) {
        return this.score-another.score;
    }

    @Override
    public boolean equals(Object another) {

        if(this==another){
            return true;
        }
        if(another==null){
            return false;
        }

        if(another.getClass ()==this.getClass ()){

            Student student=(Student)another;
            if(student.name==this.name){
                return true;
            }
        }
        return false;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }
}
